package com.ruoyi.system.service.impl;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: wenqh
 * @Date: 2024/10/24/21:51
 * @Description:
 */

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoreMapper;
import com.ruoyi.system.domain.Store;
import com.ruoyi.system.service.IStoreService;

/**
 * 商家Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-24
 */
@Service
public class StoreServiceImpl implements IStoreService
{
    @Autowired
    private StoreMapper storeMapper;

    /**
     * 查询商家
     *
     * @param id 商家主键
     * @return 商家
     */
    @Override
    public Store selectStoreById(Long id)
    {
        return storeMapper.selectStoreById(id);
    }

    /**
     * 查询商家列表
     *
     * @param store 商家
     * @return 商家
     */
    @Override
    public List<Store> selectStoreList(Store store)
    {
        return storeMapper.selectStoreList(store);
    }

    /**
     * 新增商家
     *
     * @param store 商家
     * @return 结果
     */
    @Override
    public int insertStore(Store store)
    {
        store.setCreateTime(DateUtils.getNowDate());
        return storeMapper.insertStore(store);
    }

    /**
     * 修改商家
     *
     * @param store 商家
     * @return 结果
     */
    @Override
    public int updateStore(Store store)
    {
        return storeMapper.updateStore(store);
    }

    /**
     * 批量删除商家
     *
     * @param ids 需要删除的商家主键
     * @return 结果
     */
    @Override
    public int deleteStoreByIds(Long[] ids)
    {
        return storeMapper.deleteStoreByIds(ids);
    }

    /**
     * 删除商家信息
     *
     * @param id 商家主键
     * @return 结果
     */
    @Override
    public int deleteStoreById(Long id)
    {
        return storeMapper.deleteStoreById(id);
    }
}

